import requests
from bs4 import BeautifulSoup
base_url = "https://bbs.itheima.com/forum-425-1.html"
# 请求
response = requests.get(base_url)
response.encoding = "utf-8"
# 解析网页
soup = BeautifulSoup(response.text,features="html.parser")
# 找到所有的item
items = soup.select(".new.forumtit")
# 循环
for item in items:
    # 标题
    title = item.select(".s.xst")[0].text
    print(title)
    # 作者
    author = item.select(".foruminfo>.z>a>span")[0].text
    print(author)
    date = item.select(".foruminfo > i.z > span:nth-child(2)")[0].text
    print(date)